package com.wkbb.basic.thread;

import com.wkbb.basic.model.Employee;
import com.wkbb.basic.model.User;
import com.wkbb.basic.service.ClassInfoService;
import lombok.extern.slf4j.Slf4j;

/**
 * @author dengjingyuan
 * @date 2019-12-26 17:03
 */
@Slf4j
public class ImSaveAutoGroupUserMasterOneTask implements Runnable {

    private ClassInfoService classInfoService;

    private Long orgId;

    private Short userType;

    private Employee employee;

    private User user;


    public ImSaveAutoGroupUserMasterOneTask(ClassInfoService classInfoService, Long orgId, Short userType, Employee employee, User user) {
        this.classInfoService = classInfoService;
        this.orgId = orgId;
        this.userType = userType;
        this.employee = employee;
        this.user = user;

    }

    public ImSaveAutoGroupUserMasterOneTask() {

    }

    @Override
    public void run() {
        log.info("*********ImSaveAutoGroupUserMasterOneTask********classInfoService:{},orgId:{},userType:{},classId:{},employee:{}", classInfoService, orgId,userType,employee,user);
        try {
            log.info("----------准备调用园长入群,如果classId有值,只同步园长进入一个群--------user-{}",user);
            Thread.sleep(500);
            classInfoService.saveAutoGroupUserMasterOne( orgId,  userType, employee,user);
        } catch (Exception e) {
            log.error("*******ImSaveAutoGroupUserMasterOneTask**********:{}", e.getMessage());
        }
    }
}

